const { downloadBook, parseBook } = require('../lib/modules/book')
const { parseChapter } = require('../lib/modules/chapter')
const source = require('./source.json')

const book = { author: '作者：吹牛者', bookUrl: '/biquge/3_3564/', coverUrl: '/files/article/image/3/3564/3564s.jpg', kind: '分类：历史小说', lastChapter: '第三百节 融资（五）', name: '临高启明', sourceId: '0P7MpRA64gr8KUdr' }

downloadBook(source, book.bookUrl).then(res => {
  const items = parseBook(source, res)
  items.chapters = parseChapter(source, res)

  return items
}).then(console.log)
